<?php
 header('Content-Type:text/html;charset=utf-8');   
  require_once 'common/news.dao.php';
  require_once 'common/like.dao.php';
  $id=isset($_POST['id'])?$_POST['id']:''; 
  $likecount= isset($_POST['likecount'])?$_POST['likecount']:'';
  $userip=getIP();
  $result=findNewsLike($id,$userip);
  if(!$result){
       $result=updateLikeCount($id);
       addNewsLike($id,$userip);	 		   
	   echo $likecount+1;   
  }else{
	  return false;
 } 
?>